function isPassword(value) {
	var pattern = /^[A-Za-z0-9]{6,16}$/;
	return pattern.test(value);
}
function isEmail(value) {
	var pattern = /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
	return pattern.test(value);
}
function isPetName(value) {
	if(getStrLength(value)>=32){
		return false;
	}else{
		var pattern = /^[A-Za-z0-9\u4e00-\u9fa5]{4,32}$/;
		return pattern.test(value);
	}
}
function isEmptyStr(value) {
	return /^\s*$/g.test(value);
}
//判断是符串长度
function getStrLength(str) {
    var realLength = 0, len = str.length, charCode = -1;
    for (var i = 0; i < len; i++) {
        charCode = str.charCodeAt(i);
        if (charCode >= 0 && charCode <= 128) realLength += 1;
        else realLength += 2;
    }
    return realLength;
} 
